<?php
/* @var $this ShopPanelController */
/* @var $model ShopPanel */
/* @var $form CActiveForm */
?>

<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'shop-panel-_shopbanner-form',
        // Please note: When you enable ajax validation, make sure the corresponding
        // controller action is handling ajax validation correctly.
        // See class documentation of CActiveForm for details on this,
        // you need to use the performAjaxValidation()-method described there.
        'enableAjaxValidation' => false,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
    ));
    ?>



    <?php echo $form->errorSummary($model); ?>


    <div class="form_left">
        <?php echo $form->labelEx($model, 'shopid'); ?>
    </div>
    <div class="form_right">
        <?php
        $session = new CHttpSession;
        $session->open();
        $userID = $session['user_salesmart'][3];

        $listshop = Shop::model()->findAll('flag in(1,4) and uid=' . $userID);

        $list = CHtml::listData($listshop, 'id', 'shopName');

        echo $form->dropDownList($model, 'shopid', $list);
        ?>
        <?php echo $form->error($model, 'shopid'); ?>
    </div>

    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'name'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'name', array('size' => 50, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'name'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'photo'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->fileField($model, 'photo', array('size' => 40, 'maxlength' => 50)); ?>
        <?php echo $form->error($model, 'photo'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'url'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'url', array('size' => 60, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'url'); ?>
    </div>

    <div class="clear"></div>

    <div class="form_left">
        <?php echo $form->labelEx($model, 'type'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->dropDownList($model, 'type', array('0' => 'Quảng cáo trang chủ', '1' => 'Quảng cáo thường')); ?>
        <?php echo $form->error($model, 'type'); ?>
    </div>
    <div class="clear"></div>

    <div class="form_left">
        <?php echo $form->labelEx($model, 'kieu'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->dropDownList($model, 'kieu', array('0' => 'Bình thường', '1' => 'Baner trái gộp 2 ', '2' => 'Baner phải gộp 2', '3' => 'Baner phải gộp 3')); ?>
        <?php echo $form->error($model, 'kieu'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'vitri'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'vitri', array('class' => 'easyui-numberspinner', 'style' => 'width:80px;')); ?>
        <?php echo $form->error($model, 'vitri'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'flag'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->dropDownList($model, 'flag', array('0' => 'Đang ẩn', '1' => 'Đang hiện')); ?>
        <?php echo $form->error($model, 'flag'); ?>
    </div>

    <div class="clear"></div>

    <div class="form_left">.
    </div>
    <div class="form_right">
        <?php echo CHtml::submitButton('Cập nhật'); ?>
    </div>
    <div class="clear"></div>
    <?php $this->endWidget(); ?>




</div><!-- form -->